﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace qiniuUI
{
    public partial class move_win : Form
    {
        public static bool name_num_rule;
        public static bool source_name_rule;
        public static string name_prefix;
        public static string name_postfix;
        public move_win()
        {
            InitializeComponent();
            this.FormBorderStyle = FormBorderStyle.Fixed3D;
        }
        public move_win(bool name_prefix_enable,bool name_postfix_enable)
        {
            InitializeComponent();
            prefix_text.Enabled = name_prefix_enable;
            postfix_text.Enabled = name_postfix_enable;
            source_name.Checked = true;
            source_name.Enabled = false;
            this.FormBorderStyle = FormBorderStyle.Fixed3D;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            name_num_rule = numrule.Checked;
            source_name_rule = source_name.Checked;
            name_prefix = prefix_text.Text;
            name_postfix = postfix_text.Text;
            this.DialogResult = DialogResult.OK;
        }
        private void test_change(object sender, EventArgs e)
        {
                if (numrule.Checked && !source_name.Checked){
                    font_preview.Text = prefix_text.Text + "{由0开始的递增数字}" + postfix_text.Text;
                }
                else if (source_name.Checked)
                {
                    font_preview.Text = prefix_text.Text + "{原本的名字}" + postfix_text.Text;
                    numrule.Checked = false;
                    numrule.Enabled = false;
                }else
                {
                    font_preview.Text = prefix_text.Text + "{随机产生}" + postfix_text.Text;
                    numrule.Enabled = true;
                }
        }
        private void qiniuUI_FormClosed(object sender, FormClosingEventArgs e)
        {
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }

        private void move_win_Load(object sender, EventArgs e)
        {

        }

    }
}
